import { createRouter, createWebHashHistory } from 'vue-router'

//导入自己的页面文件
import IndexVue from '../views/Index.vue'
import Page1 from'../views/Page1.vue'
import Page2 from'../views/Page2.vue'
import StudentList from '../views/StudentList.vue'; // 学生列表页面
import UserList from '../views/UserList.vue'; // 用户列表页面
import CourseList from '../views/CourseList.vue'; // 课程列表页面

//路由规则
const routes = [
  {
    path: '/',              //路径  /代表首页
    name: 'index',          //名称
    component: IndexVue,     //组件
    children:[
      {
        path: '/page1',
        name: 'page1',
        component: Page1
      },
      {
        path: '/page2',
        name: 'page2',
        component: Page2
      },

      {
        path: '/StudentList',
        name: 'StudentList',
        component: StudentList,
      },
        {
          path: '/UserList',
          name: 'UserList',
          component: UserList,
        },
        {
          path: '/CourseList',
          name: 'CourseList',
          component: CourseList,
        },

    ],
  },
  /*{
    path: '/',
    component: Layout, // 主布局组件
    children: [
      {
        path: 'students',
        name: 'StudentList',
        component: StudentList,
      },
      {
        path: 'users',
        name: 'UserList',
        component: UserList,
      },
      {
        path: 'courses',
        name: 'CourseList',
        component: CourseList,
      },
    ],


  },*/

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
